Interface sjl.RandomIterator
All Packages Class Hierarchy This Package Previous Next Index
Interface sjl.RandomIterator
- public interface RandomIterator
- extends Object
- extends BidirectionalIterator
Defines the methods allowed on random iterators. Random iterators allows
long-jumping in both directions, and comparing two iterators for
relativ ordering.
Copyright © 1996 Finn Bock
-
get(int)
- Return the object placed distance elements away.
-
less(Iterator)
- Return true if the position of this is lower than the position of target
-
next(int)
- Advance the iterator distance elements forwards (or backwards if
distance is negative).
-
prev(int)
- Advance the iterator distance elements backards (or forwards if
distance is negative).
-
put(int, Object)
- Place the object in the position distance elements away.
less
public abstract boolean less(Iterator target)
- Return true if the position of this is lower than the position of target
- Parameters:
- target - the iterator to compare with.
- Returns:
- true if this is lower than target.
get
public abstract Object get(int distance)
- Return the object placed distance elements away.
- Parameters:
- distance - a relative offset.
- Returns:
- Return the object placed distance elements away.
put
public abstract Object put(int distance,
Object object)
- Place the object in the position distance elements away.
- Parameters:
- object - the object to put into the container.
- distance - a relative offset.
- Returns:
- The object just inserted.
prev
public abstract RandomIterator prev(int distance)
- Advance the iterator distance elements backards (or forwards if
distance is negative).
- Parameters:
- distance - a relative offset.
- Returns:
- this.
next
public abstract RandomIterator next(int distance)
- Advance the iterator distance elements forwards (or backwards if
distance is negative).
- Parameters:
- distance - a relative offset.
- Returns:
- this.
All Packages Class Hierarchy This Package Previous Next Index